﻿using System;
using System.Web.UI.WebControls;
using viNews.Controllers;

public partial class Admin_Pages_viNews_Comments_ApproveComments : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void UPDATE_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in UNAPPROVED_COMMENTS.Rows)
        {
            if (((CheckBox)row.FindControl("CheckBoxIsApproved")).Checked)
            {
                int commentid = Convert.ToInt32(((Label)row.FindControl("LabelCommentId")).Text);
                CommentController.ApproveComment(commentid);
            }
        }
        Response.Redirect(Request.RawUrl);
    }

    protected void CANCEL_Click(object sender, EventArgs e)
    {
        Response.Redirect(Request.RawUrl);
    }
}

